<?
/*
 * Copyright 2004-2005 Sigve Indregard.
 *
 * This file is part of Laivsys.
 *
 * Laivsys is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Laivsys is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Laivsys; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * $Id: bilde_vis.php 6 2005-07-11 23:14:47Z say $
 */
 
include("db.php");
include("laivid.php");

$id=$_REQUEST['id'];

if ($_REQUEST['thumb'])
	$gay="Thumb";
else
	$gay="Bilde";

$sql = "SELECT $gay FROM Bilder WHERE ID=$id";
$recs=mysql_query($sql);
$rec=mysql_fetch_assoc($recs);

header("Content-type: image/png");
header("Content-Disposition: inline; filename=$gay-$id.png");
echo $rec[$gay];
?>
